function login(){
  //显示mask
  showDisableDiv();
  //显示窗口
  showWindow("用&nbsp;&nbsp;户&nbsp;&nbsp;登&nbsp;&nbsp;陆","/login.jsp");
}

function register(){
  //显示mask
  showDisableDiv();
  //显示窗口
  showWindow("用&nbsp;&nbsp;户&nbsp;&nbsp;注&nbsp;&nbsp;册","/register.jsp");
}

function checkLoginInput(){
  //检查必输项
  if(document.login.username.value==''){
    alert('请填写您的用户名！');
    document.login.username.focus();
    return;
  }
  if(document.login.username.value==''){
    alert('请填写您的密码！');
    document.login.password.focus();
    return;
  }
  document.getElementById("iptLogin").style.filter='Alpha(Opacity=20)';
  document.getElementById("iptLogin").disabled=true;
  document.login.submit();
}

function checkRegisterInput(){
  //检查必输项
  if(document.register.username.value==''){
    alert('请填写您的用户名！');
    document.register.username.focus();
    return;
  }
  if(document.register.password.value==''){
    alert('请填写您的密码！');
    document.register.password.focus();
    return;
  }
  if(document.register.confirmpassword.value==''){
    alert('请填写您的确认密码！');
    document.register.confirmpassword.focus();
    return;
  }
  if(document.register.email.value==''){
    alert('请填写email！');
    document.register.email.focus();
    return
  }
  //检查输入有效性
  if(!CheckUsername(document.register.username.value)){
    alert('用户名必需是中文、英文字母或数字！');
    document.register.username.focus();
    return;
  }
  if(document.register.password.value!=document.register.confirmpassword.value){
    alert('确认密码错误！');
    document.register.confirmpassword.focus();
    return;
  }
  if(!CheckPassword(document.register.password.value)){
    alert('密码只能是字母和数字！');
    document.register.password.focus();
    return;
  }
  if(!validateEmail(document.register.email.value)){
    alert('请填写正确的email地址！');
    document.register.email.focus();
    return;
  }
  document.getElementById("btRegister").style.filter='Alpha(Opacity=20)';
  document.getElementById("btRegister").disabled=true;
  document.register.submit();
}

//检查用户名是否已经被注册
function checkInputUserName(){
  //检查必输项
  if(Trim(document.form1.username.value)==''){
    alert('请输入用户名！');
    document.form1.username.focus();
    return;
  }
  //检查有效性
  if(!CheckUsername(form1.username.value)){
    alert('用户名必需是中文、英文字母或数字！');
    form1.username.focus();
    return;
  }

  document.getElementById("checkTr").style.display="block";

  sendRequest("/register/checkusername.do?username="+document.form1.username.value+"&noauthen=true");
}

//检查电子邮件是否已经被注册
function checkInputEmail(){
}
